{% extends 'shop/base.html' %}

{% block content %}
<div class="container">
    <h2 class="my-4">我的订单</h2>
    <div class="list-group">
        {% for order in orders %}
        <a href="{% url 'order-detail' order.id %}" class="list-group-item list-group-item-action">
            <div class="d-flex w-100 justify-content-between">
                <h5 class="mb-1">订单号: {{ order.order_no }}</h5>
                <small class="text-muted">{{ order.created_at }}</small>
            </div>
            <p class="mb-1">状态: {{ order.get_status_display }}</p>
            <small class="text-muted">点击查看详情</small>
        </a>
        {% empty %}
        <div class="alert alert-info">暂无订单</div>
        {% endfor %}
    </div>
</div>
{% endblock %}